home *** CD-ROM | disk | FTP | other *** search
Text File | 1997-09-11 | 1.2 KB | 51 lines | [TEXT/CWIE] |
- // StringCorpus.h
- // Copyright: © 1994 - 1997 by Apple Computer, Inc., all rights reserved.
-
-
- // a corpus that is a set of memory-resident strings
- // this is useful for test programs
-
- #pragma once
- #ifndef StringCorpus_h
- #define StringCorpus_h
-
- #include "IACorpus.h"
-
- const uint32 StringCorpusType = 'Str0';
-
- class StringDoc : public IADoc {
- public:
- StringDoc() : text(NULL), textLen(0) {}
- StringDoc(const char* text);
- StringDoc(char* text, uint32 textLen, bool makeCopy = true);
- // StringDoc(StringDoc& fd) : IADoc(fd) {}
- virtual ~StringDoc();
-
- IAStorable* DeepCopy() const;
- uint32 StoreSize() const;
- void Store(IAOutputBlock* output) const;
- IAStorable* Restore(IAInputBlock* input) const;
-
- bool LessThan(const IAOrderedStorable* neighbor) const;
- bool Equal(const IAOrderedStorable* neighbor) const;
-
- char* GetText() const {return text;}
- uint32 GetLength() const {return textLen;}
-
- private:
-
- char* text;
- uint32 textLen;
- };
-
- class StringCorpus : public IACorpus {
- public:
- StringCorpus() : IACorpus(StringCorpusType) {}
- // StringCorpus(StringCorpus& fc) : IACorpus(fc) {}
- virtual ~StringCorpus() {}
- IADoc* GetProtoDoc();
- IADocText* GetDocText(const IADoc* doc);
- };
-
- #endif
-